package com.controller;

import com.service.MailServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MailController {

    @Autowired
    private MailServiceImpl mailService;

    @RequestMapping(value = "/sendMail",method = RequestMethod.GET)
    public String sendMail(String mail){
        mailService.sendMail(mail);
        return "success";
    }
    @RequestMapping(value = "checkCode",method = RequestMethod.GET)
    public boolean checkCode(String mail,String code){
        System.out.println(code);
        System.out.println(mail);
        return mailService.checkCode(mail,code);
    }


}
